interface Person {
    name: string,
    age: number,
}
type Person1 = { name: string, age: number }
type PersonKeys = keyof Person; // "name" | "age"
type person1Keys = keyof Person1
const a: PersonKeys = 'age'
const b: person1Keys = 'age'


const obj: Person = {
    name: '张三',
    age: 18
}
type person2Keys = keyof typeof obj
const c: person2Keys = 'age'



interface User {
    id: number;
    name: string;
}
function isUser(value: unknown): value is User {
    return typeof value === "object" && value !== null
        && "id" in value && "name" in value;
}

console.log(isUser({id:1,name:'qq'}))